class Solution(object):
    def kthSmallest(self, root, k):
        """
        :type root: TreeNode
        :type k: int
        :rtype: int
        """
        path = []
        def DFS(root, path):
            if root == None:
                return
            DFS(root.left, path)
            path.append(root.val)
            DFS(root.right, path)
        DFS(root, path)
        return path[k-1]
